import java.util.Date;


public class GetAllStudentsForCourseTest extends AbstractTestCase {

	private static final UniManager um = UniManager.instance;
	private static final StudentFactory sf = StudentFactory.INSTANCE;
	private static final CourseFactory cf = CourseFactory.instance;
	
	private Course c;
	private Student s1, s2, s3;
	
	public void setUp() throws Exception {
		c = cf.createCourse("My special Course");
		um.addCourse(c);
		
		s1 = sf.addNewStudent(1111, "Student1111");
		s2 = sf.addNewStudent(1112, "Student1112");
		s3 = sf.addNewStudent(1113, "Student1113");

		um.registerStudent(c, s1);
		um.registerStudent(c, s2);
		um.registerStudent(c, s3);
	}
	
	public void tearDown() {
		
	}
	
	public void test() throws Exception {
		this.setUp();
		System.out.println("--------------------------------------");
		System.out.println("Start of GetAllStudentsForCourseTest: " + TIME_FORMATTER.format(new Date()));
		System.out.println();

		String result = um.getStudentsForCourse(c.getCourseID());
		System.out.println("All students for course " + c.getCourseName() + " fetched as String with result:");
		System.out.println(result);
		System.out.println();
		
		System.out.println("End of GetAllStudentsForCourseTest: " + TIME_FORMATTER.format(new Date()));
		System.out.println("--------------------------------------");
		this.tearDown();
	}

}
